package com.hgyc.mom.wms.entity;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.io.Serializable;
import com.baomidou.mybatisplus.annotation.*;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.hgyc.mom.common.annotation.Excel;
import com.hgyc.mom.core.annotation.DictColumn;
import com.hgyc.mom.core.annotation.TableDict;
import com.hgyc.mom.core.mybatis.EQ;
import com.hgyc.mom.core.mybatis.Like;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

/**
 * <p>
 * 生产退料单
 * </p>
 *
 * @author fwj
 * @since 2025-07-09
 */
@Data
@TableName("wms_product_return")
@Schema(name="生产退料单对象", description="生产退料单对象")
public class WmsProductReturn implements Serializable {
    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.ASSIGN_ID)
    @Schema(description = "退料单ID")
    private Long id;

    @Excel(name = "退料单号")
    @EQ
    @Schema(description = "退料单号")
    private String returnCode;

    @Schema(description = "生产工单ID")
    private Long workOrderId;

    @Excel(name = "工单号")
    @EQ
    @Schema(description = "工单号")
    private String workOrderCode;

    @Excel(name = "退料仓库")
    @EQ
    @Schema(description = "退料仓库")
    @TableDict(table = "wms_warehouse", key = "id" , columns = {
            @DictColumn(name ="name", alias = "warehouseName")
    })
    private Long warehouseId;

    @Excel(name = "退料日期")
    @Schema(description = "退料日期")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDate returnDate;

    @Excel(name = "单据状态")
    @EQ
    @Schema(description = "单据状态")
    private String status;

    @Excel(name = "备注")
    @Schema(description = "备注")
    private String remark;

    @TableField(fill = FieldFill.INSERT)
    @Schema(description = "创建者")
    private Long createBy;

    @TableField(fill = FieldFill.INSERT)
    @Schema(description = "创建时间")
    private LocalDateTime createTime;

    @TableField(fill = FieldFill.UPDATE)
    @Schema(description = "更新者")
    private Long updateBy;

    @TableField(fill = FieldFill.UPDATE)
    @Schema(description = "更新时间")
    private LocalDateTime updateTime;

}